/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-05-26
 * Time: 15:16
 */
public class IncreasingTriplet {
    public static boolean increasingTriplet(int[] nums) {
        int a = nums[0];
        int b = Integer.MAX_VALUE;
        for (int tmp : nums) {
            if (tmp > b) return true;
            else if (tmp > a) {
                b = tmp;
            } else {
                a = tmp;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        int[] arr = new int[]{2,1,5,0,4,6};
        System.out.println(increasingTriplet(arr));
    }
}
